<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="java.util.*"%>
<%@ include file="../../common.jsp" %>
<html>
<head>
<title>领用单详细</title>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<LINK href="<%=root%>/css/caigouxitong.css" type=text/css rel=stylesheet>
<SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/calendar.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/string.js"></SCRIPT>
</head>

<%

GSStocksBean sbean=(GSStocksBean)request.getAttribute("sbean");
GSStocksDetailBean dbean=(GSStocksDetailBean)request.getAttribute("dbean");
GSProviderBean pbean=(GSProviderBean)request.getAttribute("pbean");
GSOrganizationBean orgbean=(GSOrganizationBean)request.getAttribute("orgbean");
DecimalFormat df = new DecimalFormat("0.0000");
%>
<script type="text/javascript">
    function find(a,b){
            var rootURL = "<%=response.encodeURL(request.getContextPath()+"/A181107.do")%>?sid="+a+"&did="+b;
            window.open(encodeURI(rootURL),"","height=600,width=950,top=50,left=50,toolbar=no,menubar=no,scrollbars=yes, resizable=no,location=no, status=yes");
        }
</script>
<body BGCOLOR="#f2f2f2" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<center>

<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td height="20"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr height="20">
          <td height="20" width="2" class="mtxt_black">&nbsp;</td>
          <td height="30" width="758" class="mtxt_black" >明细调整</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="bg_line" height="2"></td>
  </tr>
</table>
<form name="form1" id="form1" method="post">
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr> 
        <td> 
            <table class=bg_table id=tableId    cellspacing=1 cellpadding=2 width=100% align=center border=0>
                <tbody> 
                <tr class="bg_column" height=20> 
                <td colspan="4">领用单整体信息</td>
                </tr>
                <tr class="bg_row_odd" height=20> 
                    <td class=top align=middle>
                        <div align="center" class="txt_content">领用单编号</div>
                    </td>
                    <td>
                    <div class="txt_content">
                         <a href="javascript:void(0);" onclick="find('<%=dbean.getGs_stocks_id() %>','<%=dbean.getGs_detail_id()%>');"><%=sbean.getGs_stocks_id()%></a>
                     </div></td>
                    <td class=top align=middle>
                        <div align="center" class="txt_content">领用单位</div>
                    </td>
                    <td class=top>
                        <%=sbean.getGs_workcorp_name() %>
                    </td>
                </tr>
                <tr class="bg_row_odd" height=20>
                    <td class=top align=middle>
                        <div align="center" class="txt_content">领取人</div>
                    </td>
                    <td class=top>
                        <%=sbean.getGs_stocks_person() %>
                    </td>
                    <td class=top align=middle>
                        <div align="center" class="txt_content">领取部门</div>
                    </td>
                    <td class=top>
                        <%=sbean.getGs_stocks_dept()%>
                    </td>
                </tr>
                 <tr class="bg_row_odd" height=20> 
                    <td class=top align=middle>
                        <div align="center" class="txt_content">领取日期</div>
                    </td>
                    <td class=top>
                        <%=sbean.getGs_stocks_date() %>
                    </td>
                    <td class=top align=middle>
                    <div align="center" class="txt_content">出货单位</div>
                    </td>
                    <td class=top>
                    <%=orgbean.getGs_org_name() %>
                    </td>
                </tr>
                <tr class="bg_row_odd" height=20> 
                    <td class=top align=middle>
                        <div align="center" class="txt_content">备注</div>
                    </td>
                    <td class=top colspan="3"><%=sbean.getGs_stocks_remark() %></td>
                </tr>
          </tbody></table></td></tr>
          <tr>
          <td>
          <table id=mx class=bg_table cellspacing=1 cellpadding=2 width=100% align=center border=0>
          <tr class="bg_column" height=20> 
          <td colspan="9">详细明细</td>
          </tr>
          <tr class="bg_column" height=20>
          <td class=top align=middle>
          <div align="center" class="txt_content">编号</div>
          </td>
          <td class=top align=middle>
          <div align="center" class="txt_content">名称</div>
          </td>
          <td class=top align=middle>
          <div align="center" class="txt_content">型号</div>
          </td>
          <td class=top align=middle>
          <div align="center" class="txt_content">供应商</div>
          </td>
          <td class=top align=middle>
          <div align="center" class="txt_content">单价(元)</div>
          </td>
          <td class=top align=middle>
          <div align="center" class="txt_content">数量</div>
          </td>
          <td class=top align=middle>
          <div align="center" class="txt_content">合计(元)</div>
          </td>
          <td class=top align=middle>
          <div align="center" class="txt_content">用途</div>
          </td>
          <td class=top align=middle>
          <div align="center" class="txt_content">备注</div>
          </td>
          </tr>
          <tr class="bg_row_odd">
          <td class="top" align="center">
          <div id='divsdetailmanid'><%=dbean.getGs_manufacture_id()%></div>
          </td>
          <td class="top" align="center">
          <div id='divsdetailmanname'>
             <a href="<%=response.encodeURL(root+"/A150103.do")%>?concentricityId=<%=dbean.getGs_concentricity_id()%>"  target="_blank"><%=dbean.getGs_manufacture_name() %></a></div>
          </td>
          <td class="top" align="center">
          <div id='divsdetailmantype'><%=dbean.getGs_manufacture_type()%></div>
          </td>
          <td class="top" align="center">
          <div id='divsdetailpro'><a href="<%=response.encodeURL(root+"/A150504.do")%>?providerId=<%=dbean.getGs_provider_id()%>" target="_blank"><%=pbean.getGs_provider_name()%></a></div>
          </td>
          <td class="top" align="center">
          <input type="text" name="price" id="price" value="<%=dbean.getGs_detail_unitprice()%>" size="10"  onblur="formatordercount(this)">
          <input type="hidden" name="oldprice" id="oldprice" value="<%=dbean.getGs_detail_unitprice()%>">
          </td>
          <td class="top" align="center">
          <input type="text" name="count" id="count" value="<%=dbean.getGs_detail_count()%>" size="10"  onblur="formatordercount(this)">
          <input type="hidden" name="oldcount" id="oldcount" value="<%=dbean.getGs_detail_count()%>">
          </td>
          <td class="top" align="center">
          <div id='divsdetailsum'><%=df.format(dbean.getGs_detail_unitprice()*dbean.getGs_detail_count())%></div>
          </td>
          <td class="top" align="center">
          <input type="text" name="use" id="use" value="<%=StringUtils.escapeXML(dbean.getGs_detail_use())%>">
          </td>
          <td class="top" align="center">
          <input type="text" name="remark" id="remark" value="<%=StringUtils.escapeXML(dbean.getGs_detail_remark())%>">
          </td>
          </tr>
          </table>
          </td>
          </tr>
          </table>
          <br>
          <input type="button" class="kuang" onclick="save();" value="修改">&nbsp;
          <input type="button" class="kuang" onclick="javascript:window.close();" value="关闭">
          </form>
          <script type="text/javascript">
            function operation(){
                var unit=document.getElementById("price").value;
                var count=document.getElementById("count").value;
                var money=parseFloat(unit)*parseFloat(count);
                document.getElementById("divsdetailsum").innerText=money.toFixed(4);
            }
            function formatordercount(obj){
                  obj.value = FormatNum2(obj);
                  operation();
              }
              function save(){
                var unit=document.getElementById("price").value;
                var count=document.getElementById("count").value;
                if(unit==null||unit==""||parseFloat(unit)<=0||isNaN(unit))
                {
                    alert("请正确输入产品数量");
                    return;
                }
                if(count==null||count==""||parseFloat(count)<=0||isNaN(count))
                {
                    alert("请正确输入产品价格");
                    return;
                }
                window.opener.document.all.price.value=document.all.price.value;
                window.opener.document.all.count.value=document.all.count.value;
                window.opener.document.all.oldprice.value=document.all.oldprice.value;
                window.opener.document.all.oldcount.value=document.all.oldcount.value;
                window.opener.document.all.use.value=document.all.use.value;
                window.opener.document.all.remark.value=document.all.remark.value;
                window.opener.location="javascript:updatebl();"
                window.close();
              }
          </script>
</body>
</html>